package com.xq.props;

import com.xq.Hunter;

/**
 * @description: 药水类
 * @author: 软妹倩哟
 * @date: Created in 2020/6/7 14:29
 * @version: 1.0
 * @modified By:
 */
public class Regeneration extends Props {
    private String description = "生命点数恢复：";

    public Regeneration(String id, String name, int effect) {
        super(id, name, effect);
    }

    public void useProps(Hunter hunter) {

        if (this.getEffect() > hunter.getMaxLife()) {
            hunter.setCurLife(hunter.getMaxLife());
        } else {
            hunter.setCurLife(hunter.getCurLife() + getEffect());
        }
    }

    @Override
    public String toString() {
        return description;
    }
}